/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ejemplothreads;

import java.util.Date;
import java.util.Random;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author AdminLocal
 */
public class ClaseHilable extends Thread
{
    int numeroHilo;

    public ClaseHilable(int i)
    {
        numeroHilo = i;
    }

    @Override
    public void run()
    {
        Random r = new Random(new Date().getTime());
        try
        {
            Thread.sleep(r.nextInt(10) * 10000);
            System.out.println("Acaba el hilo " + numeroHilo);
        } catch (InterruptedException ex)
        {
            Logger.getLogger(ClaseRunnable.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}
